
enum EServerPacketType;
struct packet_base;
class CNetrekClientListener;
class CGameRadar;
class CGamePlayerList;
class CChatList;
class CUserInput;
class CGameHud;
class CDetailViewWindow;
class CGameSoundManager;
class CGameShipExplosionManager;
class Radar;

namespace AVUI
{
    class FrameworkElement;
}

class CGameStateInGame : public CBaseGameState, public IPacketSink
{
public:
    CGameStateInGame() { }

    bool ProcessPacket(EServerPacketType, const packet_base* pPacket);
    void FrameStart();
    void Initialize(CNetrekClientListener* pListener);
    void Cleanup();
    void UpdateCamera();

    virtual void MousePressed(EMouseButtonID eMouseButtonID); // Override from BaseGameState
    virtual void KeyPressed(EKeyboardButtonID eKeyboardButtonID);
    virtual void MouseMoved(int xDiff, int yDiff, int zDiff);

private:
    bool GetMouseGridIntersection(Ogre::Vector3& vectorResult);

    Ogre::Camera* m_pCamera;
    Ogre::Viewport* m_pViewport;

    CGamePlayerList* m_pPlayerList;
    CChatList* m_pChatList;
    CUserInput* m_pUserInput;
    CGameHud* m_pGameHud;
    CGameSoundManager* m_pGameSoundManager;
    CGameShipExplosionManager* m_pGameShipExplosionManager;

    AVUI::FrameworkElement* m_pRoot;
    AVUI::FrameworkElement* m_pMainPlayfield;
    AVUI::FrameworkElement* m_pDetailViewWindow;
    AVUI::Rect m_mainRect;
    Radar* m_pNewRadar;
    bool m_fWasAlive;

    enum ECameraType
    {
        eCameraType_ThreeQuarter,
        eCameraType_Overhead
    };

    ECameraType m_eCameraType;


    float m_flCameraDistance;
    static const float c_flDefaultCameraDistance;
    static const float c_flMaxCameraDistance;
    static const float c_flMinCameraDistance;

    float m_flTimeTillNextRequest;
};




